﻿
@model IEnumerable<xiushen.Domain.Category>
@foreach(var data in Model)
{
    var books = data.Book.Take(100);
      if (books.Count() > 0)
        {
             <div class="row alert margin-top" >
        <div class="span2"><strong>@data.Name</strong></div>
        <div class="span2"><a href="@Url.Action("MoreBooks", new { categoryId = data.ID })">查看更多</a></div>
    </div>
        }
    <div class="row">
        @foreach (var book in books)
        {
            var hasContent = !string.IsNullOrEmpty(book.DirectContent);
            var actionName = "Chapters";
            if (hasContent)
            {
                actionName = "BookContent";
            }
   
        <div class="span3">
            <a href="@Url.Action(actionName, new { bookId = book.ID, categoryId = data.ID })" >@book.Name</a></div>
        }
    </div>
}
